import request from '@/utils/request'

// 查询工作项附件列表
export function listWorkAttachment(workId, query) {
  return request({
    url: '/user/project/workAttachment/list/' + workId,
    method: 'get',
    params: query
  })
}

// 查询工作项附件列表
export function listAllWorkAttachment(workId, query) {
  return request({
    url: '/user/project/workAttachment/listAll/' + workId,
    method: 'get',
    params: query
  })
}

// 查询工作项附件详细
export function getWorkAttachment(attachmentId) {
  return request({
    url: '/user/project/workAttachment/' + attachmentId,
    method: 'get'
  })
}

// 新增工作项附件
export function addWorkAttachment(workItemId, data) {
  return request({
    url: '/user/project/workAttachment/' + workItemId,
    method: 'post',
    data: data
  })
}

// 修改工作项附件
export function updateWorkAttachment(data) {
  return request({
    url: '/user/project/workAttachment/',
    method: 'put',
    data: data
  })
}

// 删除工作项附件
export function delWorkAttachment(attachmentId) {
  return request({
    url: '/user/project/workAttachment/' + attachmentId,
    method: 'delete'
  })
}
